package com.example.demo.web;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author Administrator
 */
@RestController
@RequestMapping("/v1/api/shell")
public class ShellController {
    @GetMapping
    public String shell(@RequestParam String shellCommand){
     System.err.println("shellCommand  ===> " + shellCommand);
     List<String> list = ShellCommand.exec(shellCommand);
     return  String.join("<br/>",list);
    }
}
